/**
 * @author:  maybe
 * @date: 2024/1/5 
 * @des: 微信相关的接口
 */
const axios = require('axios');
const qs = require('qs');
const { wx} = require('./../../utils/config')
// 微信登录接口
const authLogin =(code) => {
    const params = {
        secret: wx.secret,
        appid: wx.appid,
        grant_type: 'authorization_code',
        js_code: code,
    }
    // 请求微信
    return  axios.get('https://api.weixin.qq.com/sns/jscode2session?'+qs.stringify(params));
}

module.exports = {
    authLogin
}
